﻿using LuShanTea.DTO;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace LuShanTea.Front.Web.Models
{
    public class UserAddressEditModel
    {
        public long Id { get; set; }

        [Required(ErrorMessage = "用户昵称不能为空")]
        [RegularExpression(@"^[\u4E00-\u9FA5A-Za-z0-9_]{2,20}$", ErrorMessage = "请输入正确")]
        /// <summary>
        /// 收货人姓名
        /// </summary>
        public string ReciverName { get; set; }

        [Required(ErrorMessage = "区域Id不能为空")]
        /// <summary>
        /// 区域Id
        /// </summary>
        public long AreaId { get; set; }

        [Required(ErrorMessage = "详细地址不能为空")]
        [RegularExpression(@"^[\u4E00-\u9FA5A-Za-z0-9_]{0,200}$", ErrorMessage = "留言中不能出现特殊字符并且不能多余200个字")]
        /// <summary>
        /// 收货地址
        /// </summary>
        public string ReciverAddress { get; set; }

        [Required(ErrorMessage = "请输入正确的邮政编码")]
        [RegularExpression(@"[1-9]\d{5}(?!\d)", ErrorMessage = "留言中不能出现特殊字符并且不能多余200个字")]
        ///邮政编码
        public string PostEmail { get; set; }

        [Required(ErrorMessage = "手机号不能为空")]
        [Phone(ErrorMessage = "请输入正确")]
        public string PhoneNum { get; set; }

        public AddressDTO[] Addresses { get; set; }

        public ProvinceDTO[] Provinces { get; set; }

        public long ProvinceId { get; set; }

        public long CityId { get; set; }
    }
}